//导入路由
import {createRouter, createWebHashHistory} from 'vue-router'
const home=()=>import('/src/views/index/Home.vue')
const register=()=>import('/src/views/index/RegisterView.vue')
const login=()=>import('/src/views/index/Login.vue')
const about=()=>import('/src/views/index/About.vue')
const findPassword=()=>import('/src/views/index/FindPassword.vue')
// 定义路由
const routes = [
    {
      // 主页
        path: '/home',
        name: 'home',
        props: true,
        component: home        
    },
    {
      //默认路由是主界面
      path: '/',
      redirect: '/home',    //重定向，默认路由
      props: true
    },
    {
      // 注册
      path: '/register',
      name: 'register',
      props: true,
      component: register
    },
    {
      // 登录
      path: '/login',
      name: 'login',
      props: true,
      component: login
    },
    {
      //找回密码
      path: '/findPassword',
      name: 'findPassword',
      props: true,
      component: findPassword
    },
    {
      //关于
      path: '/about',
      name: 'about',
      props: true,
      component: about
    },
]
const router = createRouter({
    history: createWebHashHistory(),
    routes: routes
})
export default router